package com.cloudfun.campusshare.common.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;

/**
 * Created by CodeGenerator on 2020/06/05
 */
@Data
@ApiModel("优惠券DTO")
public class CouponCreateDTO {

    @ApiModelProperty("名称")
    @NotEmpty(message = "名称不能为空")
    @Length(min = 1, max = 20, message = "名称限制1-20个字符")
    private String name;

    @ApiModelProperty("金额")
    @NotNull(message = "金额不能为空")
    @Min(value = 1L, message = "金额限制1-10")
    @Max(value = 10L, message = "金额限制1-10")
    private Integer amount;

    @ApiModelProperty("有效天数")
    @NotNull(message = "有效时长不能为空")
    @Min(value = 1L, message = "有效时长限制1-180")
    @Max(value = 180L, message = "有效时长限制1-180")
    private Integer validDay;

}